using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Verifications;

namespace Pixysoft.Weblications.Sango.Battle
{

    class BattleSkillFactory
    {
        public static int lastingcount_now = 0;

        public static int lastingcount_forever = int.MaxValue;

        public static int lastingcount_exclude_current = 1;


        private static List<IBattleSkill> skills = new List<IBattleSkill>();

        static BattleSkillFactory()
        {
            skills.Add(new SkillColumnSkill());
            skills.Add(new SkillLineSkill());
            skills.Add(new SkillSingleContinueSkill());
            skills.Add(new SkilLSingleCriticalSkill());
            skills.Add(new SkillSingleHpDownSkill());
            skills.Add(new SkillSingleHpUpSkill());
            skills.Add(new SkillSinglePowerDownSkill());
            skills.Add(new SkilLSingleTwiceSkill());

            skills.Add(new SkillDefenseTriggerSkill());
            skills.Add(new SkillSingleFaintSkill());

            skills.Add(new PositiveAllHpSkill());
            skills.Add(new PositiveAllPowerSkill());
            skills.Add(new PositiveSinglePowerSkill());
        }

        public static IBattleSkill tryGetSkill(long skillTypeCode)
        {
            if (skillTypeCode < 0)
                return null;

            foreach (IBattleSkill bizskill in skills)
            {
                if (bizskill.accept(skillTypeCode))
                {
                    return bizskill;
                }
            }

            return null;
        }

    }
}